package com.xzc.seckill.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xzc.seckill.mapper.GoodsMapper;
import com.xzc.seckill.mapper.UserMapper;
import com.xzc.seckill.pojo.Goods;
import com.xzc.seckill.pojo.User;
import com.xzc.seckill.service.GoodsService;
import com.xzc.seckill.service.UserService;
import com.xzc.seckill.vo.GoodsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 徐生
 * @version 1.0
 * Date 2024/4/2 21:49
 * Description: GoodsServiceImpl
 */
@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {
    @Resource
    private GoodsMapper goodsMapper;

    //秒杀商品列表
    public List<GoodsVo> findGoodsVo() {
        return goodsMapper.findGoodsVo();
    }

    //根据id获取指定秒杀商品详情
    public GoodsVo findGoodsVoByGoodsId(Long goodsId) {
        return goodsMapper.findGoodsVoByGoodsId(goodsId);
    }
}
